/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qjs.smterp.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vostro 3400
 */
@Entity
@Table(name = "tb_stock_schedule")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "TbStockSchedule.findAll", query = "SELECT t FROM TbStockSchedule t"),
//    @NamedQuery(name = "TbStockSchedule.findByStockScheduleId", query = "SELECT t FROM TbStockSchedule t WHERE t.stockScheduleId = :stockScheduleId")})
public class StockSchedule extends BasePojo {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "STOCK_SCHEDULE_ID")
    private Integer stockScheduleId;
    @Column(name = "OPENDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date opendate;
    @Column(name = "OPENTIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date opentime;
    @Column(name = "CLOSETIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date closetime;
    @Column(name = "STOCK_ID")
    private Integer stockId;
    @Column(name = "SAFEGUARD1_NAME")
    private String safeguard1Name;
    @Column(name = "SAFEGUARD2_NAME")
    private String safeguard2Name;
    @Column(name = "SAFEGUARD3_NAME")
    private String safeguard3Name;
    
    
    
    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name="STOCK_SCHEDULE_ID")
    private Set<GoodsInstock> goodsInstock;

    public StockSchedule() {
    }

    public StockSchedule(Integer stockScheduleId) {
        this.stockScheduleId = stockScheduleId;
    }

    public Integer getStockScheduleId() {
        return stockScheduleId;
    }

    public void setStockScheduleId(Integer stockScheduleId) {
        this.stockScheduleId = stockScheduleId;
    }

    public Date getOpendate() {
        return opendate;
    }

    public void setOpendate(Date opendate) {
        this.opendate = opendate;
    }

    public Date getOpentime() {
        return opentime;
    }

    public void setOpentime(Date opentime) {
        this.opentime = opentime;
    }

    public Date getClosetime() {
        return closetime;
    }

    public void setClosetime(Date closetime) {
        this.closetime = closetime;
    }

    public Integer getStockId() {
        return stockId;
    }

    public void setStockId(Integer stockId) {
        this.stockId = stockId;
    }

    public String getSafeguard1Name() {
        return safeguard1Name;
    }

    public void setSafeguard1Name(String safeguard1Name) {
        this.safeguard1Name = safeguard1Name;
    }

    public String getSafeguard2Name() {
        return safeguard2Name;
    }

    public void setSafeguard2Name(String safeguard2Name) {
        this.safeguard2Name = safeguard2Name;
    }

    public String getSafeguard3Name() {
        return safeguard3Name;
    }

    public void setSafeguard3Name(String safeguard3Name) {
        this.safeguard3Name = safeguard3Name;
    }

    
    public Set<GoodsInstock> getGoodsInstock() {
		return goodsInstock;
	}

	public void setGoodsInstock(Set<GoodsInstock> goodsInstock) {
		this.goodsInstock = goodsInstock;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (stockScheduleId != null ? stockScheduleId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StockSchedule)) {
            return false;
        }
        StockSchedule other = (StockSchedule) object;
        if ((this.stockScheduleId == null && other.stockScheduleId != null) || (this.stockScheduleId != null && !this.stockScheduleId.equals(other.stockScheduleId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qjs.smterp.model.StockSchedule[ stockScheduleId=" + stockScheduleId + " ]";
    }
    
}
